package com.szl.code;

import java.lang.management.ManagementFactory;

import static java.lang.Thread.sleep;

public class Main {

    public static void main(String[] args) throws InterruptedException {

        // get name representing the running Java virtual machine.
        String name = ManagementFactory.getRuntimeMXBean().getName();
        System.out.println(name);
        // get pid
        String pid = name.split("@")[0];
        System.out.println("Pid:" + pid);

        People p1 = new People("sizengli", 23);
        People p2 = new People("zanzan", 22);
        Util util = new Util();
        while(true){
            int agetotal = util.sumOfAge(p1, p2);
            System.out.println(agetotal);
            sleep(3000);
        }
    }

}
